import urllib.request
def demo1(url):
    resp=urllib.request.urlopen(url)
    return resp.read()
def demo2(url):
    resp=urllib.request.Request(url)
    resp.add_header('Host','www.baidu.com')
    r = urllib.request.urlopen(resp)
    return r.read()
print(demo1('http://www.baidu.com'))
print(demo2('http://www.baidu.com'))
